<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .p1 {
            display: inline-block;
        }

        .slide-fade-enter-active {
            transition: all .3s ease;
        }

        .slide-fade-leave-active {
            transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
        }

        .slide-fade-enter,
        .slide-fade-leave-to
        {
            transform: translateX(-100px);
            opacity: 0;
        }
    </style>
</head>

<body>
    <main id="app">
        <div>
            <button @click="show = !show">点击我</button>
        </div>
        <!-- 指定name为slide-fade -->
        <transition name="slide-fade">
            <p class="p1" v-show="show">我是p标签</p>
        </transition>
    </main>
</body>
<script src="../vue.js"></script>
<script>
    new Vue({
        el: "#app",
        data() {
            return {
                show: false
            }
        }
    })
</script>

</html>